import type { RouteRecordRaw } from 'vue-router'
import defaultLayout from '@/layout/default-layout.vue'
import lifeCalendarLayout from '@/views/life-calendar/layout/life-calendar-layout.vue'

import technologyWikiRoutes from './technology-wiki'

const routes: RouteRecordRaw[] = [
  ...technologyWikiRoutes,
  {
    path: '/home',
    name: 'home',
    component: defaultLayout,
    children: [
      {
        path: '',
        name: 'home-index',
        component: () => import('@/views/home/index.vue')
      }
    ]
  },
  /* form-create && 表单设计器 */
  {
    path: '/form-create',
    name: 'formCreate',
    component: defaultLayout,
    children: [
      {
        path: '',
        name: 'formCreate-index',
        component: () => import('@/views/form-create/index.vue')
      },
      {
        path: 'designer',
        name: 'formCreate-designer',
        component: () => import('@/views/form-create/form-create-designer.vue')
      }
    ]
  },
  /* 计算器 */
  {
    path: '/calculator',
    name: 'calculator',
    component: defaultLayout,
    children: [
      {
        path: '',
        name: 'calculator-index',
        component: () => import('@/views/calculator/index.vue')
      }
    ]
  },
  /* 人生日历 */
  {
    path: '/life-calendar',
    name: 'lifeCalendar',
    component: lifeCalendarLayout,
    children: [
      {
        path: '',
        name: 'lifeCalendar-index',
        component: () => import('@/views/life-calendar/index.vue')
      }
    ]
  }
]

export default routes
